import * as types from './mutations_types'

module.exports = {
	[types.UPDATE_USERINFO] (state, user) {
		state.userinfo = user || {}
	},

	[types.REMOVE_USERINFO] (state) {
		state.userinfo = {}
	},

	[types.UPDATE_USERAUTHINFO] (state, userauth) {
		state.userauth = userauth || {}
	},

	[types.COURSEPREVIEW] (state, preview) {
		state.classpreview = preview || {}
	},

	[types.SEARCHUSER] (state, student) {
		state.classstudent = student || {}
	},

	[types.ADDCOURSE] (state) {
		state.addclassflag = 1
	},

	[types.COURSENOTICE] (state,notice) {
		state.classnotice = notice || {}
	},

	[types.CLASSSIGNIN] (state){
		state.classignflag = 1
	},
//1
	[types.GETPUBLISHCLASS] (state, classes) {
		state.publishclassinfo = classes || {}
	},
	[types.GETERRINFO] (state, errmsg) {
		state.errinfo = errmsg || {}
	},
//2
	[types.CREATECLASS] (state){
		state.createclassmsg = 1
	},
//3
	[types.GETPERSONSTEACHERS] (state,teachers){
		//debugger
		state.teachersinfo = teachers || {}
	},
	[types.GETPERSONSALLUSERS] (state,allusers){
		//debugger
		state.allusersinfo = allusers || {}
	},
//4
	[types.GETCLASSATTENDENCE] (state, attendence) {
		//debugger
		state.classattendence = attendence || {}
	},
//5
	[types.UPDATECLASS] (state){
		state.updateclassinfo = 1
	},
//6	
	[types.GETCLASSATTENDENCEDETAIL] (state,attendencedetail){
		//debugger
		state.classattendencedetail = attendencedetail || {}
	},
	//6	
	[types.GETCLASSLEAVEINFO] (state,leaveinfo){
		//debugger
		state.classleaveinfo = leaveinfo || {}
	},
//7
	[types.LEAVECLASS] (state){
		state.leaveclassinfo = 1
	},
//8
	[types.DELETECLASS] (state){
		state.deleteclassall = 1
	},
	
	[types.GETMYCLASS] (state,classes){
		state.myclass = classes
	}
}
